package reno.eureka.timecycle;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import reno.eureka.timecycle.common.ScheduleService;

@EnableEurekaClient
@SpringBootApplication
public class TimecycleApplication {

    public static void main(String[] args) {
        SpringApplication.run(TimecycleApplication.class, args);
        init();
    }

    private static void init() {
        String cetusUrl = "https://api.warframestat.us/pc/cetusCycle";
        ScheduleService cetusScheduleService = new ScheduleService(cetusUrl, "Cetus");
        Thread cetus = new Thread(cetusScheduleService);
        cetus.start();
        String vallisUrl = "https://api.warframestat.us/pc/vallisCycle";
        ScheduleService vallisScheduleService = new ScheduleService(vallisUrl, "Vallis");
        Thread vallis = new Thread(vallisScheduleService);
        vallis.start();
    }

}